package com.jiezuo.flowable.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiezuo.flowable.entity.MyNotifySetting;
import com.jiezuo.flowable.mapper.MyNotifySettingMapper;
import com.jiezuo.flowable.service.MyNotifySettingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
* @description   知会消息设置
* @author        庞留杰
* @date          2024/10/22 16:50
* @version       V1.0
**/
@Transactional
@Slf4j
@Service
public class MyNotifySettingServiceImpl extends ServiceImpl<MyNotifySettingMapper, MyNotifySetting> implements MyNotifySettingService{

    @Autowired
    MyNotifySettingMapper mapper;

    @Override
    public IPage<MyNotifySetting> findPage(Page initMpPage, MyNotifySetting myNotifySetting) {
        IPage<MyNotifySetting> page = mapper.findList(initMpPage, myNotifySetting);
        return page;
    }

    @Override
    public List<MyNotifySetting> findList(MyNotifySetting myNotifySetting) {
        List<MyNotifySetting> list = mapper.findList(myNotifySetting);
        return list;
    }

    @Override
    public MyNotifySetting findById(String id) {
        return this.getById(id);
    }

    @Override
    public boolean add(MyNotifySetting myNotifySetting) {
        return this.save(myNotifySetting);
    }

    @Override
    public boolean update(MyNotifySetting myNotifySetting) {
        return this.updateById(myNotifySetting);
    }

    @Override
    public boolean delete(String id) {
        MyNotifySetting myNotifySetting = new MyNotifySetting();
        myNotifySetting.setId(id);
        myNotifySetting.setIs_delete("1");
        return this.updateById(myNotifySetting);
    }

    @Override
    public List<MyNotifySetting> findListByType(MyNotifySetting myNotifySetting) {
        return mapper.findListByType(myNotifySetting);
    }
}
